-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(sdk-core): add MPCv2 wallet creation #4438
Conversation
cbcd2ff
to
fb2416d
Compare
87c629a
to
ac9bb4a
Compare
be9ebca
to
2d852fe
Compare
// Get the BitGo public key based on user/enterprise feature flags | ||
// If it doesn't work, use the default public key from the constants | ||
const bitgoPublicGpgKey = ( | ||
(await this.getBitgoGpgPubkeyBasedOnFeatureFlags(params.enterprise)) ?? this.bitgoPublicGpgKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we switch to having DKLs using a baked in BitGo pub key instead of fetching from a server? It is much more secure that way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope for now. We can do this before GA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(continuing review in person)
// Get the BitGo public key based on user/enterprise feature flags | ||
// If it doesn't work, use the default public key from the constants | ||
const bitgoPublicGpgKey = ( | ||
(await this.getBitgoGpgPubkeyBasedOnFeatureFlags(params.enterprise)) ?? this.bitgoPublicGpgKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope for now. We can do this before GA.
MpcUtils = | ||
this.baseCoin.getMPCAlgorithm() === 'eddsa' | ||
? EDDSAUtils.default | ||
: params.walletVersion === 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
walletVersion is specific to eth, it will not work for cosmos chains. What about using mpcTypeVersion instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cant introduce any new param, right now we are just using walletVersion to test but its gonna default to dkls later on, for every ecdsa coin that uses tss
} | ||
|
||
if (isTss) { | ||
if (!this.baseCoin.supportsTss()) { | ||
throw new Error(`coin ${this.baseCoin.getFamily()} does not support TSS at this time`); | ||
} | ||
if (params.walletVersion === 5 && !this.baseCoin.supportsMPCv2()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are adding checks on walletVersion at multiple places, this will require changes when we onboard cosmos chains. I think we should introduce some other parameter like mpcVersionType and infer wallet version as 5 if it is evm chain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, cosmos chains uses a default wallet version or no wallet version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cosmos chains don't use wallet version at all
* Flag indicating if this coin supports MPCv2 wallets. | ||
* @returns {boolean} True if MPCv2 Wallets can be created for this coin | ||
*/ | ||
supportsMPCv2(): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better move it to coinFeatures
7d1cf4e
7d1cf4e
to
4eaf7ff
Compare
4eaf7ff
to
eaf5f62
Compare
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is an install script?Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts. Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead. What is protestware?This package is a joke, parody, or includes undocumented or hidden behavior unrelated to its primary function. Consider that consuming this package my come along with functionality unrelated to its primary purpose. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
7086f57
to
ce51732
Compare
ce51732
to
b73d992
Compare
b73d992
to
3b15e71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
added MPCv2 wallet creation
WP-1686
TICKET: WP-1686